import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_ahj_app/base/basewidget/model/BaseModel.dart';

abstract class BaseViewModel<T extends BaseModel> {
  T model;

  @mustCallSuper
  void init(BuildContext context) {
    model = initModel;
  }
  Stream<DioError> errorStream() => model.errorData;

  T get initModel;
  void dispose() {
    if (model != null) {
      model.dispose();
    }
  }


}
